#pragma once
#include "Entity.h"
#include <vector>
using namespace std;
class CWaypoint;
class CPlayer;
class CTargetBox;
#include "Frame.h"
#include "AnimationInfo.h"
class CAvatar;
class CAnimationManager;class CElemental : 
	public CEntity
{
public:
	CElemental(void);
	~CElemental(void);

	virtual void Update( float fElapsedTime );
	virtual void Render( void );
	virtual bool CheckCollision( IEntity * pOther );


	vector<short> GetElementalSouls()		{ return m_vQueueSouls; }
	void SetElementalSouls(vector<short> souls)		{ m_vQueueSouls = souls; }
	short GetSingleSoul(short index)				{return m_vQueueSouls[index];}
	void SetStartWaypoint(CWaypoint* startSpot)		{m_pWaypoint = startSpot;}
	void SetOwner( CPlayer* summoner)				{m_pOwner = summoner;}
	CPlayer* GetOwner( void )						{return m_pOwner;}
	void DealDamage( CEntity* target );

	void CheckForTarget( int laneNum );

	void SetAoe( bool ham )							{m_bHasAoe = ham;}
	bool GetAoe(void)								{return m_bHasAoe;}
	void SetLane( int lane )						{m_nLaneNumber = lane;}
	int GetLane(void)								{return m_nLaneNumber;}
	void SetTarget( CEntity* destory )				{m_pTarget = destory;}
	CEntity* GetTarget(void)						{return m_pTarget;}

	CTargetBox* GetTargetBox(void)					{return m_pRangeBox;}
	void SetTargetBox( int nX, int nY, short range );

	//void SetUpAnimation();
	//void LoadTextures( int W, int C, int T, int J, int H );
	//CEntity* GetTarget() {return m_pTarget;}
	//CWaypoint* GetWaypoint() {return m_pWaypoint;}
	//void SetTarget( CEntity* target) {m_pTarget = target;}
	//void PlayAnimation( string animation );
	//Animation* currAnimation;
protected:
	enum ElementalTypes { Fire, Water, Air, Earth };
private:
	bool firstTime;
	vector<short> m_vQueueSouls;
	CEntity* m_pTarget;
	CWaypoint* m_pWaypoint;
	bool m_bCalculateVec;
	CPlayer*	m_pOwner;
	CAnimationManager*	m_pAnimManager;
	CAnimationInfo		m_pCurrAnimInfo;	CTargetBox*	m_pRangeBox;

	vector<CElemental*> checkVec;

	int			m_nLaneNumber;

	bool showExtraDamage;

	bool m_bHasTarget;
	bool m_bHasAoe;
	float attackTimer;
	bool targetDeleted;
	bool m_bResetVec;};
